package Runde3;

public class Rectangle implements ScalablePolygon {

	private double a;
	private double b;
	
	//Creates a new rectangle with given side lengths; a > 0, b > 0
	public Rectangle(double a, double b) {
		this.a = a;
		this.b = b;
	}
	
	//Scales the polygon's size by the given factor; factor > 0
	public void scale(double factor) {
		a *= factor;
		b *= factor;	
	}

	//Returns the rectangle's area (> 0.0)
	public double area() {
		return a*b;
	}

	//Returns the rectangle's perimeter (> 0.0)
	public double perimeter() {
		return 2*a+2*b;
	}
	
	//Returns the rectangle's amount of edges (obviously always 4)
	public int edges() {
		return 4;
	}

}
